﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Bank_Account.ascx.cs" Inherits="ERP.Modules.Bank_Account" %>

<%-------------------------------%>
<ext:Hidden ID="FormatTypeBank_Account" runat="server" />
<ext:Panel runat="server" Layout="Fit" Border="False" ID="PanelBank_Account">
    <Content>
<%--------------GridBank_Account-----------------%>
<ext:GridPanel
    ID="grBank_Account"
    Cls="grid-double"
    runat="server"
    EnableColumnMove="true"
    Border="False">
    <Store>
        <%-------------StoreBank_Account-----------------%>
        <ext:Store
            ID="StoreBank_Account"
            runat="server"
            OnReadData="StoreBank_Account_RefreshData"
            PageSize="20">
            <Model>
                <ext:Model ID="ModelBank_Account" runat="server" IDProperty="Bank_Account_ID">
                    <Fields>
                        <ext:ModelField Name="Bank_Account_Name" Type="String" />
                        <ext:ModelField Name="Bank_Name" Type="String" />
                        <ext:ModelField Name="Bank_Account_Note" Type="String" />
                    </Fields>
                </ext:Model>
            </Model>
        </ext:Store>
    </Store>
    <ColumnModel ID="ColumnModelBank_Account" runat="server">
        <Columns>
            <ext:RowNumbererColumn ID="RowNumbererColumn1" runat="server" Width="30" Align="Center" />
            <ext:Column ID="Column2" runat="server" Text="Tên tài khoản" Width="200" DataIndex="Bank_Account_Name"></ext:Column>
            <ext:Column ID="Column3" runat="server" Text="Tên ngân hàng" Width="200" DataIndex="Bank_Name"></ext:Column>
            <ext:Column ID="Column1" runat="server" Text="Ghi chú" Width="200" DataIndex="Bank_Account_Note" Flex="1"></ext:Column>
        </Columns>
    </ColumnModel>
    <DirectEvents>
        <ItemDblClick OnEvent="Bank_AccountDblClick">
            <ExtraParams>
                <ext:Parameter Name="Bank_Account_ID" Value="record.data.Bank_Account_ID" Mode="Raw" />
            </ExtraParams>
            <EventMask ShowMask="true" Msg="Đang tải..." />
        </ItemDblClick>
    </DirectEvents>
    <SelectionModel>
        <ext:CheckboxSelectionModel ID="CheckboxSelectionModelBank_Account" runat="server" Mode="Multi">
            <Listeners>
                <SelectionChange Handler="
                    if (selected.length == 0) {
                        #{btnEdit}.disable();
                        #{btnDel}.disable();
                        #{btnExport}.disable();
                    } else {
                        #{btnEdit}.enable();
                        #{btnDel}.enable();
                        #{btnExport}.enable();
                    }" />
            </Listeners>
        </ext:CheckboxSelectionModel>
    </SelectionModel>
    <DockedItems>
        <ext:Toolbar ID="ToolbarTopMain" runat="server" Dock="Top">
            <Items>
                <ext:Button ID="btnAddNew" runat="server" Text="Thêm mới" Icon="ApplicationAdd">
                    <DirectEvents>
                        <Click OnEvent="btnAddNew_Click">
                            <EventMask ShowMask="true" Msg="Đang tải..." />
                        </Click>
                    </DirectEvents>
                </ext:Button>

                <ext:Button ID="btnEdit" runat="server" Text="Sửa" Icon="ApplicationEdit">
                    <DirectEvents>
                        <Click OnEvent="btnEdit_Click">
                            <EventMask ShowMask="true" Msg="Đang tải..." />
                        </Click>
                    </DirectEvents>
                </ext:Button>

                <ext:Button ID="btnDel" runat="server" Text="Xoá" Icon="ApplicationDelete">
                    <DirectEvents>
                        <Click OnEvent="btnDel_Click">
                            <EventMask ShowMask="true" Msg="Đang tải..." />
                            <ExtraParams>
                                <ext:Parameter Name="name" Value="btnDel"></ext:Parameter>
                            </ExtraParams>
                            <Confirmation ConfirmRequest="true"
                                Title="Thông Báo" Message="Bạn có muốn xoá mẫu tin này không ?">
                            </Confirmation>
                        </Click>
                    </DirectEvents>
                </ext:Button>

                <ext:Button ID="btnExport" runat="server" Text="Xuất tập tin" Icon="Printer">
                    <Menu>
                        <ext:Menu ID="MenuMain" runat="server">
                            <Items>
                                <ext:MenuItem ID="MenuItemExportXML" runat="server" Text="XML" Icon="PageCode">
                                    <Listeners>
                                        <Click Handler="submitValue(#{grBank_Account}, #{FormatTypeBank_Account}, 'xml');" />
                                    </Listeners>
                                </ext:MenuItem>
                            </Items>
                        </ext:Menu>
                    </Menu>
                </ext:Button>

            </Items>
        </ext:Toolbar>
        <ext:Toolbar ID="ToolbarPagging" runat="server" Dock="Bottom" AnchorHorizontal="100%">
            <Items>
                <ext:TriggerField ID="txtSearch" runat="server" Width="200" EnableKeyEvents="true" MarginSpec="0 8 0 0">
                    <Triggers>
                        <ext:FieldTrigger Icon="Search" />
                    </Triggers>
                    <DirectEvents>
                        <TriggerClick OnEvent="Search_Event"></TriggerClick>
                        <KeyPress OnEvent="Search_Event"></KeyPress>
                    </DirectEvents>
                </ext:TriggerField>
                <ext:PagingToolbar ID="PagingToolbarBank_Account" runat="server" StoreID="StoreBank_Account" BeforePageText="Trang" AfterPageText="của {0}" LastText="Cuối" NextText="Kế tiếp" PrevText="Trở lại" FirstText="Đầu" RefreshText="Làm tươi" DisplayInfo="true" DisplayMsg="Trang {0} - {1} của {2}" />
            </Items>
        </ext:Toolbar>
    </DockedItems>
</ext:GridPanel>
        </Content>
</ext:Panel>
<ext:Panel runat="server">
    <Content>
<%-----------WindowsBank_Account-----------------%>
<ext:Window ID="WindowsBank_Account" runat="server"
    Title="Cập nhật tài khoản"
    DefaultAnchor="100%"
    Width="379px"
    Height="207px"
    Hidden="true"
    AutoScroll="false"
    Maximizable="False"
    Minimizable="False"
    AutoDataBind="true"
    Region="Center"
    Resizable="false"
    Modal="true"
    HideMode="Offsets"
    Border="false"
    Padding="5"
    DefaultButton="btnSavePopUp">
    <Items>
        <ext:Toolbar ID="ToolbarBank_Account" runat="server">
            <Items>
                <ext:Button runat="server" Text="Lưu lại" Icon="Disk" ID="btnSavePopUp">
                    <DirectEvents>
                        <Click OnEvent="btnSavePopUp_Click" Before="return #{FormPanelBank_Account}.isValid();">
                            <EventMask ShowMask="true" Msg="Đang tải..." />
                        </Click>
                    </DirectEvents>
                </ext:Button>
                <ext:Button runat="server" Text="Huỷ bỏ" Icon="Decline" ID="btnCancelPopUp">
                    <DirectEvents>
                        <Click OnEvent="btnCancelPopUp_Click">
                            <EventMask ShowMask="true" Msg="Đang tải..." />
                        </Click>
                    </DirectEvents>
                </ext:Button>
                <ext:TextField ID="txtBank_Account_ID" runat="server" FieldLabel="ID" LabelAlign="Right" Hidden="true" />
            </Items>
        </ext:Toolbar>
        <ext:FormPanel ID="FormPanelBank_Account" runat="server"
            AutoHeight="true"
            BodyPadding="10"
            Frame="true"
            DefaultAnchor="100%">
            <Items>
                <ext:TextField ID="txtBank_Account_Name" runat="server" FieldLabel="Tên tài khoản" AnchorHorizontal="100%" AllowBlank="false" />
                <ext:TextField ID="txtBank_Name" runat="server" FieldLabel="Tên ngân hàng" AnchorHorizontal="100%" AllowBlank="false" />
                <ext:TextArea ID="txtBank_Account_Note" runat="server" FieldLabel="Ghi chú" AnchorHorizontal="100%" />
            </Items>
        </ext:FormPanel>
    </Items>
</ext:Window>
</Content>
</ext:Panel>